#!/bin/bash
name="Lin_绫全系列管理脚本"
version="Lin_3.0"
purple="\033[35m"
white="\033[0m"
red="\033[31m"
yellow="\033[33m"
blue="\033[34m"
cyan="\033[36m"
green="\033[32m"
lin_home="$HOME/Lin_home"
lin_menu="$lin_home/Lin_menu"
lin_setting="$lin_menu/setting"
lin_files=$(dirname "$(which bash)")
gitee_home="https://gitee.com/lingfengai/Lin_home"
gitee_menu="https://gitee.com/lingfengai/Lin_menu"
user_book_gitee="$gitee_home/raw/master/LICENSE"
setting_txt="#注：请不要自行修改该文件内容
#1为开启，2为关闭
check=1
update=1
#密钥的值
key="
source /etc/os-release
distro="$NAME$VERSION"
if [ "$(uname -o)" == "GNU/Linux" ]; then
    if command -v apt-get >/dev/null 2>&1; then
        PM="apt install -y"
    elif command -v pacman >/dev/null 2>&1; then
        PM="pacman -Syu --noconfirm"
    else
        echo -e "$cyan请确认$purple Linux发行版$cyan是否受支持$white"
        exit 6
    fi
elif [ "$(uname -o)" == "Android" ]; then
    echo -e "正在安装依赖"
    pkg install -y which
    PM="pkg install -y"
else
    echo -e "$red无法确认系统$white"
fi
echo -e "----------------$name----------------"
sleep 0.05
echo -e "MADE BY：lingfengai"
sleep 0.05
echo -e "版本号：$version"
sleep 0.05
echo -e "----------------检查系统及软件包----------------"
sleep 0.05
echo -e "系统：$distro"
sleep 0.05
echo -e "使用的软件包命令：$PM"
user_menu() {
echo -e "请阅读并同意用户协议，不同意请按Ctrl+C"
echo -e "输入m以联网获取用户协议，y表示同意，n表示不同意"
read user_op
case $user_op in
[yY]) echo -e y ;;
[nN]) echo -e n;exit 6 ;;
[mM] )echo -e m ;;
esac
}
main_menu() {
main="${purple}请对应数字${yellow}来选择你需要的选项
${cyan}╭───┬───────┬────────┬────────────╮
│${blue} 选项         │       描述       │
├───┼───────┼────────┼────────────┤
│${blue} 1 │    ${cyan} Lin_menu  │ 绫的全能工具箱  │
│${blue} 0 │   ${cyan} 退出脚本 │ see you again │
╰───┴───────┴────────┴────────────╯"
echo -e "${yellow}注:暂时${purple}没有${white}"
echo -e "$main"
echo -e "请输入一个 ${yellow}选项${white}"
read main_op
case $main_op in
1) echo -e 1 ;;
0) echo -e 0 ;;
*) echo -e "${green}请输入${yellow}正确的选项${white}"
   main_menu ;;
esac
}
sleep 0.05
user_menu
main_menu